#include <QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    int N,s=0,k=1;
    cout<<"Vvedite chislo: ";
    cin>>N;
   while (s<N)
   {
       s=s+k;
       k++;
   }
    cout<<"K: "<<k<<endl<<"summa: "<<s-k;
    return a.exec();
}
